Field of the Invention
The present invention relates to an optical communication system and, particularly, to a system for bringing the states of buses into agreement when the two electric buses in a network are connected together through optical fibers.
A field LAN for industrial use is installed on a field and is subject to be affected by electromagnetic noise from power cables and by lightning. If an optical fiber which is a noise-resistant transmission medium is used instead of an electric cable, therefore, it becomes possible to bury the power line and the control LAN in the same channel. Generally, however, the optical transmission devices are more expensive than the electric transmission equipment. When the whole apparatus is connected by using optical fibers, therefore, the system cost is driven up. On the other hand, the optical transmission equipment is used only in limited places in the system. Therefore, if the places where expensive optical transmission devices are used are limited, then, the cost of the system can be suppressed.
To meet this demand, a constitution has been put into practical use as an optical linking device (LWZ440) for a program controller (S10/2 .alpha.) in our company (Hitachi, Ltd.) in which the electric buses are partly replaced by optical fibers, and both ends of the optical fibers are connected to the electric buses via photo-electric conversion devices.
In a system using the controller S10/2 .alpha.and the device LWZ440, the master of the control LAN is limited to only one controller and, hence, a signal that flows into the control LAN is either from master to slave or from slave to master. Therefore, the optical linking device LWZ440 changes over the direction of transmission in a unit of a packet transfer to realize the transmission of data between the master and the slave.
A conventional control system, in which the electric buses are partly replaced by optical fibers, is constituted by a master that outputs an instruction to the control LAN and a plurality of slaves that operate upon receiving the instruction. This is because, when there exist many masters, the control LAN itself must have an arbitration function to simultaneously output control data (instructions) to the control LAN, and it becomes difficult to exchange the data in a predetermined period in real time.
However, when the master is a controller, even a manual operation cannot be accomplished from the operation board in case the controller becomes defective. Therefore, an instruction system had to be separately provided to halt the whole system in case of emergency.
To solve this problem, a multi-master system is required enabling a plurality of nodes connected to the control LAN to become masters. An ISO11898 standard is one of the transfer systems that corresponds to the multi-master system.
According to the transfer system of the ISO11898 standard as disclosed in Japanese Patent Laid-Open No. 236333/1994, a plurality of nodes are connected using serial lines of the form of buses, enabling the data to be simultaneously outputted to the LAN from a plurality of nodes.
According to this standard, furthermore, the data are transferred as every node outputs data to the serial line and detects the state of the bus repetitively for every bit. Moreover, each node drives the bus at the time when a logic 0 is outputted to the serial line but does not drive the bus when a logic 1 is outputted, in order to transfer the data bit by bit. Thus, even with one node, the bus assumes the state of logic 0 when the logic 0 is outputted.
Therefore, every node detects the state of the bus after the data is outputted. At this moment, the value outputted to the bus is compared with the state of the bus and when they are not in agreement, the node no more outputs the data. Thus, the nodes successively interrupt the transmission of packet, thereby executing the arbitration.
In a system based on the ISO11898 standard, unlike the conventional system of a single master, the states of all buses must be brought into agreement while a bit is being transferred. In a system which changes over the direction of transmission using optical fibers in a unit of a packet as in the above-mentioned optical linking device (LWZ440), therefore, it is not allowed to bring the states of electric buses at both ends of the optical fiber into agreement.
It is therefore presumed that the state of one electric bus is transmitted to the driven state, a logic 0 state, the driven state outputted by a logic 0 of another electric bus via an optical fiber. Optical bus-bridging devices attached to both ends of the optical fiber observe the states of the electric buses to which they are connected, produce an optical output upon confirming that the electric bus is being driven, and transmit it to the other optical bus-bridging device via the optical fiber. Upon detecting an optical input from the optical fiber, the other bus-bridging device drives the electric bus. Thus, the drive state of the one electric bus is transmitted to the other electric bus via the optical fiber.
However, when the transmission of the state of the bus and the response are executed in two directions in the optical linking devices by using two optical fibers to realize a multi-master system, there may often be formed an optical loop by the two optical linking devices and the optical fibers, resulting in the occurrence of a "deadlocked situation" or a "crossing situation" as described below, making it difficult to properly bring the states into agreement.
FIG. 17 illustrates a problem stemming from the optical linking devices of two directions. In this system, a node 1 and a node 2 drive the electric buses a and b to which they are connected. Optical linking devices a and b are connected to both ends of the optical fibers, the optical linking device a being connected to the bus a and the optical linking device b being connected to the bus b. The optical linking devices a and b output light to the optical fibers when the electric buses to which they are connected are driven. Conversely, when light is inputted from the optical fibers, the optical linking devices a and b drive the electric buses to which they are connected.
(1) It is now presumed that none of the two electric buses a and b have been driven in the initial state. In this case, none of the buses a and b are driven, and none of the optical linking devices a and b are producing optical output to the optical fiber, maintaining a stable state.
(2) In this state, the node 1 connected to the bus a drives the bus a.
(3) Upon detecting the fact that the bus a is driven, the optical linking device a produces an optical output to the optical fiber. Upon receiving this optical output, the optical linking device b starts driving the bus b.
(4) The bus b is driven by the optical linking device b, and the node 2 detects the fact that the bus b is being driven. Since the bus b is in a state in which it is being driven, the optical linking device b produces optical output to the optical fiber. Accordingly, the optical linking device a starts driving the bus a.
(5) Next, the node 1 no longer drives the bus a. However, since the optical linking device a continues to drive the bus a, the bus a is maintained driven. Both the bus a and the bus b remain stable in a state of being driven. Thus, a large latch loop is formed by the two optical fibers and two optical linking devices. Finally, therefore, the buses a and b remain stable in a state of being driven despite they are driven by none of the nodes, resulting in the occurrence of a so-called "deadlocked situation".
Moreover, when the two electric buses a and b are driven to assume the ON state during a transfer cycle, the optical linking devices a and b, respectively, judge that the buses of their own sides are turned ON and work to produce optical outputs to the optical fibers in an effort to turn the buses of the other sides ON, establishing a "crossing situation". In the "crossing situation", the bus drive signals of the optical linking devices a and b are exchanged between the two buses; i.e., the buses a and b vibrate in repeating ON/OFF state.